<?php

namespace app\index\controller;

use think\Controller;
use think\Request;

class Move extends Controller
{
  public function index()
  {
      return view("index");
  }

  public function buy(Request $request)
  {
      if($request->isGet()){
          $ids = $request->param('ids');
          $ids = rtrim($ids,"|");
          $this->assign('ids',$ids);
          return view("buy");
      }else{
          $data = $request->param("data");
          $data = str_replace("cart-item-","",$data);
          $data = explode("|",$data);
          $result = curl_data("http://swoole.phpdongyi.cn:10000",$data,1);
          return json(json_decode($result));
      }

  }

}